<template>
    <div style="background-color: gray; text-align: center;">
        <h4>学习Suspense</h4>
        {{ num }}
        <button @click="num++">+</button>
    </div>
</template>

<script>
import { ref } from 'vue'
export default {
    name: 'StudySuspense',
    async setup() {
        let num = ref(0)

        let p = new Promise((resolve, reject) => {
            setTimeout(() => {
                resolve({
                    num
                })
            }, 3000)
        })
        return await p
    }
}
</script>

<style>

</style>